import QtQuick 2.0

Rectangle {
    id: exam
    width: 200
    height: 300
    color: "linen"

    // 按键元素
    Keys.onLeftPressed: x -= 5
    Keys.onRightPressed: x += 5
    Keys.onUpPressed: y -= 5
    Keys.onDownPressed: y += 5
    Keys.onPressed: {
        switch(event) {
        case Qt.Key_Plus:
            exam.scale += 0.2;
            break;
        case Qt.Key_Minus:
            exam.scale -= 0.2;
            break;
        }
    }

    focus: true

    CLineEdit {
        id: i1
        anchors.top: parent.top
        anchors.topMargin: 30
        anchors.horizontalCenter: parent.horizontalCenter
        // tab切换焦点
        KeyNavigation.tab: i2
    }

    CLineEdit {
        id: i2
        anchors.top: i1.bottom
        anchors.topMargin: 5
        anchors.horizontalCenter: parent.horizontalCenter
        // tab切换焦点
        KeyNavigation.tab: it1
    }

    CTextEdit {
        id: it1
        anchors.top: i2.bottom
        anchors.topMargin: 5
        anchors.horizontalCenter: parent.horizontalCenter
        KeyNavigation.tab: i1
    }
}
